home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / share / perl5 / XML / Atom.pm next >
Encoding:
Perl POD Document  |  2012-03-04  |  2.0 KB  |  103 lines

  1. # $Id$
  2.  
  3. package XML::Atom;
  4. use strict;
  5.  
  6. use 5.008_001;
  7. our $VERSION = '0.37';
  8.  
  9. BEGIN {
  10.     @XML::Atom::EXPORT = qw( LIBXML );
  11.     if (eval { require XML::LibXML }) {
  12.         *{XML::Atom::LIBXML} = sub() {1};
  13.     } else {
  14.         require XML::XPath;
  15.         *{XML::Atom::LIBXML} = sub() {0};
  16.     }
  17.     local $^W = 0;
  18.     *XML::XPath::Function::namespace_uri = sub {
  19.         my $self = shift;
  20.         my($node, @params) = @_;
  21.         my $ns = $node->getNamespace($node->getPrefix);
  22.         if (!$ns) {
  23.             $ns = ($node->getNamespaces)[0];
  24.         }
  25.         XML::XPath::Literal->new($ns ? $ns->getExpanded : '');
  26.     };
  27.  
  28.     $XML::Atom::ForceUnicode = 0;
  29.     $XML::Atom::DefaultVersion = 0.3;
  30. }
  31.  
  32. sub libxml_parser {
  33.     ## uses old XML::LibXML < 1.70 interface for compat reasons
  34.     return XML::LibXML->new(
  35.         #no_network      => 1, # v1.63+
  36.         expand_xinclude => 0,
  37.         expand_entities => 1,
  38.         load_ext_dtd    => 0,
  39.         ext_ent_handler => sub { warn "External entities disabled."; '' },
  40.     );
  41. }
  42.  
  43. sub expat_parser {
  44.     return XML::Parser->new(
  45.         Handlers => {
  46.             ExternEnt => sub { warn "External Entities disabled."; '' },
  47.             ExternEntFin => sub {},
  48.         },
  49.     );
  50. }
  51.  
  52. use base qw( XML::Atom::ErrorHandler Exporter );
  53.  
  54. package XML::Atom::Namespace;
  55. use strict;
  56.  
  57. sub new {
  58.     my $class = shift;
  59.     my($prefix, $uri) = @_;
  60.     bless { prefix => $prefix, uri => $uri }, $class;
  61. }
  62.  
  63. sub DESTROY { }
  64.  
  65. use vars qw( $AUTOLOAD );
  66. sub AUTOLOAD {
  67.     (my $var = $AUTOLOAD) =~ s!.+::!!;
  68.     no strict 'refs';
  69.     ($_[0], $var);
  70. }
  71.  
  72. 1;
  73. __END__
  74.  
  75. =head1 NAME
  76.  
  77. XML::Atom - Atom feed and API implementation
  78.  
  79. =head1 SYNOPSIS
  80.  
  81.     use XML::Atom;
  82.  
  83. =head1 DESCRIPTION
  84.  
  85. Atom is a syndication, API, and archiving format for weblogs and other
  86. data. I<XML::Atom> implements the feed format as well as a client for the
  87. API.
  88.  
  89. =head1 LICENSE
  90.  
  91. I<XML::Atom> is free software; you may redistribute it and/or modify it
  92. under the same terms as Perl itself.
  93.  
  94. =head1 AUTHOR
  95.  
  96. Benjamin Trott, Tatsuhiko Miyagawa
  97.  
  98. =head1 COPYRIGHT
  99.  
  100. All rights reserved.
  101.  
  102. =cut
  103.